#!/usr/env python
#-*-coding: utf-8 -*-

#BUBBLESORT(A)
# for i = 1 to A,length -1
#  for j = A,length downto i+1
#   ifA[j] < A[j -1]
#    exchange A[j] with A[j-1]
#


class BubbleSort:
    
    def __init__(self):
        """
        class para objectos do algoritmo bubblesort
        """
        pass
    pass    
    
    #
    # BubbleSort algoritm
    # - arrayA, the list of objects to be sorted
    def bubble_Sort(self, arrayA):
        """ Bubble-Sort algoritm to  sort a list
        of unsorted objects.
        arrayA - list of object to sort
        """        
        for i in range(len(arrayA)):
            for j in range(len(arrayA)-1, i, -1):
                if arrayA[j] < arrayA[j -1]:
                    temp = arrayA[j]
                    arrayA[j] = arrayA[j-1]
                    arrayA[j-1] = temp
                pass
            pass
        pass
    pass
pass
